import request from '@/utils/request';

export interface CateLiftData {
    data: any;
    categoryL1List: never[];
    cate1List: never[];
    id: number,
    superCategoryId: number,
    showIndex: number,
    name: string,
    frontName: null,
    frontNameIcon: null,
    frontDesc: null,
    bannerUrl: null,
    bannerList: null,
    iconUrl: null,
    imgUrl: null,
    level: null,
    subCateList: [],
    wapBannerUrl: null,
    type: number,
    wapExpandPicTargetUrl: null,
    categoryType: number,
    extra: null
}

export interface cateGoryLis{
    currentCategory: bannerList5[]
    categoryL2List:categoryL2List[]
    cate1List:CateLiftData[]
}

export interface bannerList{
    materialContentFrom: number,
    materialName: string,
    rcmdSort: boolean,
    taskType: number,
    itemFrom: number,
    crmUserGroupName: string,
    resourcesId: number,
    materialType: string,
    crmUserGroupId: 0,
    materialId: number,
    taskId: number
}

export interface bannerList6{
    id: string,
    superCategoryId: number,
    showIndex: number,
    name: string,
    frontName: null,
    frontNameIcon: null,
    frontDesc: null,
    bannerUrl: string,
    bannerList: null,
    iconUrl: null,
    imgUrl: null,
    level: null,
    subCateList: [],
    wapBannerUrl: string,
    type: 0,
    wapExpandPicTargetUrl: null,
    categoryType: number,
    extra: bannerList[]

}

export interface bannerList{
    categoryGroupList: bannerList6
}

export interface categoryL2List{
    id: number,
    superCategoryId: number,
    showIndex: number,
    name: string,
    frontName:null ,
    frontNameIcon: null,
    frontDesc: null,
    bannerUrl: string,
    bannerList: null,
    iconUrl: null,
    imgUrl: null,
    level: null,
    subCateList: [],
    wapBannerUrl: string,
    type: number,
    wapExpandPicTargetUrl: null,
    categoryType: number,
    extra: categoryL2List1
}

export interface categoryL2List1{
    materialContentFrom: number,
    materialName: string,
    rcmdSort: boolean,
    taskType: number,
    itemFrom: number,
    crmUserGroupName: string,
    resourcesId: number,
    materialType: string,
    crmUserGroupId: number,
    materialId: number,
    taskId: number
}

export interface categoryGroupList{
    data: any;
    categoryGroupList: categoryGroupList1[]
    id:number
    name:string
    categoryList:categoryGroupList1[],
    currentCategory: bannerList5
}


export interface bannerList5{
    id: number,
    name: null,
    currentCategory: bannerList6[] 
    picUrl:string
    bannerList:getGoeryList[]
}


export interface getGoeryList{
    id:number,
    pricUrl:string,
    targetUrl:string
}

export interface categoryGroupList1{
    id: number,
    superCategoryId: number,
    showIndex: number,
    name: string,
    frontName: string,
    frontNameIcon: null,
    frontDesc: string,
    bannerUrl: null,
    bannerList: null,
    iconUrl: null,
    imgUrl: null,
    level: string,
    subCateList: [],
    wapBannerUrl: string,
    type: number,
    wapExpandPicTargetUrl: null,
    categoryType: number,
    extra: null
}

export type ShopListData = {
    id: number,
    listPicUrl: string,
    name: string,
    seoTitle: null,
    simpleDesc:  string,
    primaryPicUrl: string,
    primarySkuId: number,
    retailPrice: number,
    counterPrice: null,
    sortOriginPrice: number,
    status: number,
    rank: number,
    soldOut: false,
    underShelf: false,
    updateTime: number,
    itemDetail: null,
    skuList: null,
    attrList: null,
    skuMap: null,
    skuSpecList: null,
    sellVolume: number,
    reportPicList: null,
    issueList: null,
    unitPrice: null,
    tagList: null,
    hdrkDetailVOList: null,
    comments: null,
    newItemFlag: true,
    primarySkuPreSellPrice: number,
    primarySkuPreSellStatus: number,
    pieceNum: number,
    pieceUnitDesc: string,
    colorNum: number,
    limitedFlag: number,
    promId: number,
    preLimitFlag: number,
    gradientPrice: null,
    productPlace: string,
    remark: null,
    flashPageLink: string,
    promotionDesc: string,
    specialPromTag: string,
    extraPrice:string ,
    appExclusiveFlag: false,
    appExclusivePrice: null,
    promTag: null,
    tryOutEventReport: null,
    layawayList: null,
    itemTagList: [
        {
            type: number,
            subType: number,
            name: string,
            tagId: number,
            itemId: number,
            forbidJump: false,
            freshmanExclusive: false
        }
    ],
    isPreemption: number,
    preemptionStatus: number,
    couponShortNameList: null,
    buttonType: number,
    sloganTip: null,
    showTime: number,
    onSaleTime: number,
    characteristicList: null,
    itemPromValid: true,
    autoOnsaleTime: number,
    autoOnsaleTimeLeft: number,
    displaySkuId: number,
    saleCenterDesc: null,
    presentUrl: null,
    saleCenterSkuId: number,
    saleCenterSkuSpec: null,
    topCommentVO: null,
    itemType: number,
    adBanners: null,
    points: number,
    showPoints: false,
    pointsPrice: number,
    valueReturnDesc: null,
    forbidExclusiveCal: false,
    commentCount: number,
    commentWithPicCount: number,
    freightInfo: null,
    itemLimit: null,
    itemSizeTableFlag: false,
    itemSizeTableDetailFlag: false,
    itemSizeTableList: null,
    freeTryVO: null,
    purchaseRate: null,
    jumpUrl: null,
    zcSearchFlag: false,
    featuredSeries: null,
    pointsStatus: number,
    sortFlag: number,
    spmcBanner: null,
    appFreshmanBannerVO: null,
    source: number,
    categoryList: null,
    depositDetailVO: null,
    scenePicUrl: string,
    couponPrice: null,
    bonusBanner: null,
    couponConflict: true,
    extraServiceFlag: number,
    forbiddenBuy: false,
    forbidBuyDesc: null,
    bigPromotion: null,
    spmcOpenGiftItemDesc: null,
    discountDesc: null,
    subtractPriceDesc: null,
    goodCmtRate: null,
    showCommentEntrance: true,
    relatedItemCommentTag: null,
    rewardDesc: null,
    categoryL2Id: number,
    promLogo: null,
    listPromBanner: null,
    detailPromBanner: null,
    promoTip: null,
    rewardShareFlag: false,
    shoppingReward: null,
    shoppingRewardRule: null,
    promDesc: null,
    promoTips: null,
    picMode: number,
    extra: null,
    recommendReason: null,
    shieldSpecialChannel: false,
    itemDiscountDetail: null,
    spmcFinalPriceBannerVO: null,
    buyTitle: null,
    noticeText: null,
    skuFreight: null,
    proDiscount: null,
    purchaseMethodVO: null,
    fullRefundPolicy: null,
    freeTryId: number,
    zoomTransPicV2Url: string,
    monthlySavingCard: null,
    welfareCardVO: null,
    brandInfo: null,
    simpleBrandInfo: null,
    countryInfo: null,
    finalPriceInfoVO: {
        banner: {
            logo: null,
            title: null,
            price: null,
            content: string
        },
        priceInfo: {
            finalPrice: {
                prefix: string,
                price: number,
                suffix: null
            },
            counterPrice: number,
            basicPrice: null
        },
        type: number
    },
    topLogo: {
        logoUrl: string,
        width: number,
        height: number,
        type: number
    },
    preLogo: [
        {
            logoUrl: string,
            width: number,
            height: number,
            type: number
        }
    ],
    price: null,
    banner: null,
    showPrice: boolean,
    pointTag: null,
    pointTagExtra: null,
    pointTagPrefix: null,
    zc: boolean,
    wapSchemeUrl: null,
    auctionInfoVO: null,
    spmcFinalPriceCalcResultBean: null,
    listProPriceInfoDTO: null
}

export interface itemList{
  
}

export const getCateLiftList = () => {
    return request.get<any,CateLiftData>('/item/cateList.json')
}

export const getCateShopList = (subCategoryId:number,categoryId:number) => {
    return request.get<any,CateLiftData>(`/item/list.json?__timestamp=1630133942864&categoryType=0&subCategoryId=${subCategoryId}&categoryId=${categoryId}}`)
}

export const getcateList = (id:number)=>{
    return request.get<any,categoryGroupList>(`/item/cateList.json?__timestamp=1630131455012&categoryId=${id}`)
}

